﻿// Developer Express Code Central Example:
// How to define NavBarGroups in different modules with Prism
// 
// This example defines two modules with NavBarGroup objects. The modules are
// injected into NavBarControl using a NavBarControlAdapter
// object.
// NavBarControlAdapter sets the NavBarControl.ItemsSource property to a
// collection of Views (each of which is a NavBarGroup object).
// 
// You can find sample updates and versions for different programming languages here:
// http://www.devexpress.com/example=E3342

using DevExpress.Xpf.NavBar;
using Microsoft.Practices.Prism.Regions;

namespace Abc.Desktop.Adapters
{
    public class NavBarControlAdapter : RegionAdapterBase<NavBarControl>
    {
        public NavBarControlAdapter(IRegionBehaviorFactory behaviorFactory)
            : base(behaviorFactory)
        {
        }
        protected override void Adapt(IRegion region, NavBarControl regionTarget)
        {
            regionTarget.ItemsSource = region.Views;
        }
        protected override IRegion CreateRegion()
        {
            return new Region();
        }
    }
}
